Intra-prediction mode-based image processing method and device therefor

ABSTRACT

Disclosed are an intra-prediction mode-based image processing method and a device therefor. Particularly, a method for processing an image on the basis of an intra-prediction mode may comprise the steps of: configuring a reference sample to be used for prediction of a current block on the basis of width information and height information of the current block when the current block is a non-square block; deriving an intra-prediction mode of the current block; and generating a prediction sample of the current block by using the reference sample on the basis of the intra-prediction mode of the current block.

TECHNICAL FIELD

The present invention relates to a method for processing a still imageor moving image and, more particularly, to a method forencoding/decoding a still image or moving image based on anintra-prediction mode and an apparatus supporting the same.

BACKGROUND ART

Compression encoding means a series of signal processing techniques fortransmitting digitized information through a communication line ortechniques for storing information in a form suitable for a storagemedium. The medium including a picture, an image, audio, etc. may be atarget for compression encoding, and particularly, a technique forperforming compression encoding on a picture is referred to as videoimage compression.

Next-generation video contents are supposed to have the characteristicsof high spatial resolution, a high frame rate and high dimensionality ofscene representation. In order to process such contents, a drasticincrease in the memory storage, memory access rate and processing powerwill result.

Accordingly, it is required to design a coding tool for processingnext-generation video contents efficiently.

DISCLOSURE Technical Problem

The present invention proposes a method of efficiently performingprediction by taking into consideration the characteristics of a blockshape when a prediction block is generated in a non-square block unit byperforming prediction within a frame (or prediction within a frame).

Furthermore, the present invention proposes a method of configuring areference sample to be used for intra prediction by taking intoconsideration a shape of a non-square block.

Furthermore, the present invention proposes a method of adaptivelydistributing the prediction direction of an intra prediction mode bytaking into consideration a shape of a non-square block.

Furthermore, the present invention proposes a method of adaptivelysplitting a transform unit, that is, a basic unit by which transform isperformed, by taking into consideration a shape of a non-square block.

Technical objects to be achieved in the present invention are notlimited to the above-described technical objects, and other technicalobjects not described above may be evidently understood by a personhaving ordinary skill in the art to which the present invention pertainsfrom the following description.

Technical Solution

In an aspect of the present invention, a method of processing videobased on an intra prediction mode may include configuring a referencesample to be used for the prediction of a current block based on widthand height information of the current block when the current block is anon-square block, deriving an intra prediction mode of the currentblock, and generating a prediction sample of the current block using thereference sample based on the intra prediction mode of the currentblock.

In another aspect of the present invention, an apparatus processingvideo based on an intra prediction mode may include a reference sampleconfiguration unit configured to configure a reference sample to be usedfor the prediction of a current block based on width and heightinformation of the current block when the current block is a non-squareblock, a prediction mode derivation unit configured to derive an intraprediction mode of the current block, and a prediction sample generationunit configured to generate a prediction sample of the current blockusing the reference sample based on the intra prediction mode of thecurrent block.

Preferably, the step of deriving the intra prediction mode of thecurrent block further includes the step of adaptively determining aplurality of intra prediction modes applicable to the current blockbased on the width and height information of the current block. Theintra prediction mode of the current block may be derived among theplurality of determined intra prediction modes.

Preferably, when the width of the current block is N and the height ofthe current block is M, the reference sample may be configured with onesample neighboring a top left of the current block, M samplesneighboring a left of the current block, N samples neighboring a bottomleft of the current block, N samples neighboring a top of the currentblock and M samples neighboring a top right of the current block.

Preferably, the plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes in whichprediction directions are differentially distributed based on a ratio ofthe width and height of the current block.

Preferably, when the width is greater among the width and height of thecurrent block, the plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes in which thenumber of prediction directions is more distributed between theprediction direction of an angle of 45° and the prediction direction ofan angle of 135° than between the prediction direction of the angle of135° and the prediction of an angle of 225°.

Preferably, when the height is greater among the width and height of thecurrent block, the plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes in which thenumber of prediction directions is more distributed between theprediction direction of an angle of 135° and the prediction of an angleof 225° than between the prediction direction of an angle of 45° and theprediction direction of the angle of 135°.

Preferably, the plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes from which aspecific number of prediction directions have been removed based on aratio of the width and height of the current block.

Preferably, the plurality of intra prediction modes applicable to thecurrent block may be determined by sub-sampling a prediction directionof a specific angle range based on a ratio of the width and height ofthe current block.

Preferably, the plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes from which aplurality of prediction directions has been removed based on a ratio ofthe width and height of the current block and to which predictiondirections have been added to a specific angle range including avertical mode or horizontal mode as many as the number of removedprediction directions.

Preferably, the plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes from which aplurality of prediction directions has been removed based on a ratio ofthe width and height of the current block and to which predictiondirections have been added between a plurality of prediction directionsneighboring to a vertical mode or horizontal mode as many as the numberof removed prediction directions.

Preferably, the method further includes determining whether to split thecurrent block into a plurality of square sub-blocks based on a ratio ofthe width and height of the current block. If the current block is notsplit into a plurality of square sub-blocks, the prediction sample ofthe current block may be generated in a current block unit. If thecurrent block is split into a plurality of square sub-blocks, theprediction sample of the current block may be generated in a sub-blockunit. The sub-block may be identical with a transform unit transforminga residual signal of the current block.

Preferably, the method further includes splitting the current block intoa plurality of square sub-blocks when the width is greater among thewidth and height of the current block and the angle of an intraprediction mode of the current block is greater than 180°. Theprediction sample of the current block may be generated in the sub-blockunit using the reference sample based on the intra prediction mode ofthe current block. The sub-block may be identical with a transform unittransforming a residual signal of the current block.

Preferably, the method further includes splitting the current block intoa plurality of square sub-blocks when the height is greater among thewidth and height of the current block and the angle of the intraprediction mode of the current block is smaller than 90°. The predictionsample of the current block may be generated in the sub-block unit usingthe reference sample based on the intra prediction mode of the currentblock. The sub-block may be identical with a transform unit transformingthe residual signal of the current block.

Preferably, the method further includes splitting the current block intoa plurality of square sub-blocks. The prediction sample of the currentblock may be generated in the sub-block unit using the reference samplebased on the intra prediction mode of the current block. The sub-blockmay be identical with a transform unit transforming the residual signalof the current block.

Advantageous Effects

In accordance with an embodiment of the present invention, intraprediction in a non-square block can be efficiently applied byconfiguring a reference sample to be used for prediction byincorporating a shape of a non-square block.

Furthermore, in accordance with an embodiment of the present invention,prediction performance can be improved and coding performance can beenhanced by disposing more prediction directions on the side of adirection having a less error.

Furthermore, in accordance with an embodiment of the present invention,the precision of prediction can be improved by removing a direction,having a higher prediction error, and disposing a detailed directionthat may not be represented by the existing method as many as the numberof removed directions.

Furthermore, in accordance with an embodiment of the present invention,the distance from a reference sample can be reduced by splitting atransform unit from a non-square block, and thus a prediction error canbe effectively reduced and the precision of prediction can be improved.

Effects which may be obtained in the present invention are not limitedto the above-described effects, and other technical effects notdescribed above may be evidently understood by a person having ordinaryskill in the art to which the present invention pertains from thefollowing description.

DESCRIPTION OF DRAWINGS

The accompanying drawings, which are included herein as a part of thedescription for help understanding the present invention, provideembodiments of the present invention, and describe the technicalfeatures of the present invention with the description below.

FIG. 1 illustrates a schematic block diagram of an encoder in which theencoding of a still image or video signal is performed, as an embodimentto which the present invention is applied.

FIG. 2 illustrates a schematic block diagram of a decoder in whichdecoding of a still image or video signal is performed, as an embodimentto which the present invention is applied.

FIG. 3 is a diagram for describing a split structure of a coding unitthat may be applied to the present invention.

FIG. 4 is a diagram for describing a prediction unit that may be appliedto the present invention.

FIG. 5 is an embodiment to which the present invention is applied and isa diagram illustrating an intra-prediction method.

FIG. 6 illustrates a prediction direction according to anintra-prediction mode.

FIG. 7 is a diagram for illustrating a split structure of a block whichmay be applied to the present invention.

FIG. 8 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of configuring a referencesample.

FIG. 9 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of configuring a referencesample.

FIG. 10 is an embodiment to which the present invention may be appliedand is a diagram for illustrating a method of adaptively determining anintra prediction mode.

FIG. 11 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of adaptively determining anintra prediction mode.

FIG. 12 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of adaptively determining anintra prediction mode.

FIGS. 13 to 15 are embodiments to which the present invention may beapplied and are diagrams illustrating a method of adaptively determiningan intra prediction mode.

FIGS. 16 and 17 are embodiments to which the present invention may beapplied and are diagrams illustrating a method of adaptively determiningan intra prediction mode.

FIG. 18 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 19 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 20 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 21 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 22 is a flowchart illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 23 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 24 is a diagram illustrating an intra prediction method accordingto an embodiment of the present invention.

FIG. 25 is a diagram illustrating an intra prediction unit according toan embodiment of the present invention.

MODE FOR INVENTION

Hereinafter, a preferred embodiment of the present invention will bedescribed by reference to the accompanying drawings. The descriptionthat will be described below with the accompanying drawings is todescribe exemplary embodiments of the present invention, and is notintended to describe the only embodiment in which the present inventionmay be implemented. The description below includes particular details inorder to provide perfect understanding of the present invention.However, it is understood that the present invention may be embodiedwithout the particular details to those skilled in the art.

In some cases, in order to prevent the technical concept of the presentinvention from being unclear, structures or devices which are publiclyknown may be omitted, or may be depicted as a block diagram centering onthe core functions of the structures or the devices.

Further, although general terms widely used currently are selected asthe terms in the present invention as much as possible, a term that isarbitrarily selected by the applicant is used in a specific case. Sincethe meaning of the term will be clearly described in the correspondingpart of the description in such a case, it is understood that thepresent invention will not be simply interpreted by the terms only usedin the description of the present invention, but the meaning of theterms should be figured out.

Specific terminologies used in the description below may be provided tohelp the understanding of the present invention. Furthermore, thespecific terminology may be modified into other forms within the scopeof the technical concept of the present invention. For example, asignal, data, a sample, a picture, a frame, a block, etc may be properlyreplaced and interpreted in each coding process.

Hereinafter, in this specification, a “processing unit” means a unit inwhich an encoding/decoding processing process, such as prediction,transform and/or quantization, is performed. Hereinafter, forconvenience of description, a processing unit may also be called a“processing block” or “block.”

A processing unit may be construed as having a meaning including a unitfor a luma component and a unit for a chroma component. For example, aprocessing unit may correspond to a coding tree unit (CTU), a codingunit (CU), a prediction unit (PU) or a transform unit (TU).

Furthermore, a processing unit may be construed as being a unit for aluma component or a unit for a chroma component. For example, theprocessing unit may correspond to a coding tree block (CTB), codingblock (CB), prediction block (PB) or transform block (TB) for a lumacomponent. Alternatively, a processing unit may correspond to a codingtree block (CTB), coding block (CB), prediction block (PB) or transformblock (TB) for a chroma component. Furthermore, the present invention isnot limited thereto, and a processing unit may be construed as a meaningincluding a unit for a luma component and a unit for a chroma component.

Furthermore, a processing unit is not essentially limited to a squareblock and may be constructed in a polygon form having three or morevertices.

Furthermore, hereinafter, in this specification, a pixel, a pictureelement, etc. are collectively called a sample. Furthermore, to use asample may mean to use a pixel value, a picture element value or thelike.

FIG. 1 is illustrates a schematic block diagram of an encoder in whichthe encoding of a still image or video signal is performed, as anembodiment to which the present invention is applied.

Referring to FIG. 1, the encoder 100 may include a video split unit 110,a subtractor 115, a transform unit 120, a quantization unit 130, adequantization unit 140, an inverse transform unit 150, a filtering unit160, a decoded picture buffer (DPB) 170, a prediction unit 180 and anentropy encoding unit 190. Furthermore, the prediction unit 180 mayinclude an inter-prediction unit 181 and an intra-prediction unit 182.

The video split unit 110 splits an input video signal (or picture orframe), input to the encoder 100, into one or more processing units.

The subtractor 115 generates a residual signal (or residual block) bysubtracting a prediction signal (or prediction block), output by theprediction unit 180 (i.e., by the inter-prediction unit 181 or theintra-prediction unit 182), from the input video signal. The generatedresidual signal (or residual block) is transmitted to the transform unit120.

The transform unit 120 generates transform coefficients by applying atransform scheme (e.g., discrete cosine transform (DCT), discrete sinetransform (DST), graph-based transform (GBT) or Karhunen-Loeve transform(KLT)) to the residual signal (or residual block). In this case, thetransform unit 120 may generate transform coefficients by performingtransform using a prediction mode applied to the residual block and atransform scheme determined based on the size of the residual block.

The quantization unit 130 quantizes the transform coefficient andtransmits it to the entropy encoding unit 190, and the entropy encodingunit 190 performs an entropy coding operation of the quantized signaland outputs it as a bit stream.

Meanwhile, the quantized signal outputted by the quantization unit 130may be used to generate a prediction signal. For example, a residualsignal may be reconstructed by applying dequatization and inversetransformation to the quantized signal through the dequantization unit140 and the inverse transform unit 150. A reconstructed signal may begenerated by adding the reconstructed residual signal to the predictionsignal output by the inter-prediction unit 181 or the intra-predictionunit 182.

Meanwhile, during such a compression process, neighbor blocks arequantized by different quantization parameters. Accordingly, an artifactin which a block boundary is shown may occur. Such a phenomenon isreferred to a blocking artifact, which is one of important factors forevaluating image quality. In order to decrease such an artifact, afiltering process may be performed. Through such a filtering process,the blocking artifact is removed and the error of a current picture isdecreased at the same time, thereby improving image quality.

The filtering unit 160 applies filtering to the reconstructed signal,and outputs it through a playback device or transmits it to the decodedpicture buffer 170. The filtered signal transmitted to the decodedpicture buffer 170 may be used as a reference picture in theinter-prediction unit 181. As described above, an encoding rate as wellas image quality can be improved using the filtered picture as areference picture in an inter-picture prediction mode.

The decoded picture buffer 170 may store the filtered picture in orderto use it as a reference picture in the inter-prediction unit 181.

The inter-prediction unit 181 performs temporal prediction and/orspatial prediction with reference to the reconstructed picture in orderto remove temporal redundancy and/or spatial redundancy. In this case, ablocking artifact or ringing artifact may occur because a referencepicture used to perform prediction is a transformed signal thatexperiences quantization or dequantization in a block unit when it isencoded/decoded previously.

Accordingly, in order to solve performance degradation attributable tothe discontinuity of such a signal or quantization, signals betweenpixels may be interpolated in a sub-pixel unit by applying a low passfilter to the inter-prediction unit 181. In this case, the sub-pixelmeans a virtual pixel generated by applying an interpolation filter, andan integer pixel means an actual pixel that is present in areconstructed picture. A linear interpolation, a bi-linearinterpolation, a wiener filter, and the like may be applied as aninterpolation method.

The interpolation filter may be applied to the reconstructed picture,and may improve the accuracy of prediction. For example, theinter-prediction unit 181 may perform prediction by generating aninterpolation pixel by applying the interpolation filter to the integerpixel and by using the interpolated block including interpolated pixelsas a prediction block.

The intra-prediction unit 182 predicts a current block with reference tosamples neighboring the block that is now to be encoded. Theintra-prediction unit 182 may perform the following procedure in orderto perform intra-prediction. First, the intra-prediction unit 182 mayprepare a reference sample necessary to generate a prediction signal.Furthermore, the intra-prediction unit 182 may generate a predictionsignal using the prepared reference sample. Furthermore, theintra-prediction unit 182 may encode a prediction mode. In this case,the reference sample may be prepared through reference sample paddingand/or reference sample filtering. A quantization error may be presentbecause the reference sample experiences the prediction and thereconstruction process. Accordingly, in order to reduce such an error, areference sample filtering process may be performed on each predictionmode used for the intra-prediction.

The prediction signal (or prediction block) generated through theinter-prediction unit 181 or the intra-prediction unit 182 may be usedto generate a reconstructed signal (or reconstructed block) or may beused to generate a residual signal (or residual block).

FIG. 2 illustrates a schematic block diagram of a decoder in whichdecoding of a still image or video signal is performed, as an embodimentto which the present invention is applied.

Referring to FIG. 2, the decoder 200 may include an entropy decodingunit 210, a dequantization unit 220, an inverse transform unit 230, anadder 235, a filtering unit 240, a decoded picture buffer (DPB) 250 anda prediction unit 260. Furthermore, the prediction unit 260 may includean inter-prediction unit 261 and an intra-prediction unit 262.

Furthermore, a reconstructed video signal output through the decoder 200may be played back through a playback device.

The decoder 200 receives a signal (i.e., bit stream) output by theencoder 100 shown in FIG. 1. The entropy decoding unit 210 performs anentropy decoding operation on the received signal.

The dequantization unit 220 obtains transform coefficients from theentropy-decoded signal using quantization step size information.

The inverse transform unit 230 obtains a residual signal (or residualblock) by inverse transforming the transform coefficients by applying aninverse transform scheme.

The adder 235 adds the obtained residual signal (or residual block) tothe prediction signal (or prediction block) output by the predictionunit 260 (i.e., the inter-prediction unit 261 or the intra-predictionunit 262), thereby generating a reconstructed signal (or reconstructedblock).

The filtering unit 240 applies filtering to the reconstructed signal (orreconstructed block) and outputs the filtered signal to a playbackdevice or transmits the filtered signal to the decoded picture buffer250. The filtered signal transmitted to the decoded picture buffer 250may be used as a reference picture in the inter-prediction unit 261.

In this specification, the embodiments described in the filtering unit160, inter-prediction unit 181 and intra-prediction unit 182 of theencoder 100 may be identically applied to the filtering unit 240,inter-prediction unit 261 and intra-prediction unit 262 of the decoder,respectively.

Processing Unit Split Structure

In general, a block-based image compression method is used in thecompression technique (e.g., HEVC) of a still image or a video. Theblock-based image compression method is a method of processing an imageby splitting it into specific block units, and may decrease memory useand a computational load.

FIG. 3 is a diagram for describing a split structure of a coding unitwhich may be applied to the present invention.

An encoder splits a single image (or picture) into coding tree units(CTUs) of a quadrangle form, and sequentially encodes the CTUs one byone according to raster scan order.

In HEVC, a size of CTU may be determined as one of 64×64, 32×32, and16×16. The encoder may select and use the size of a CTU based onresolution of an input video signal or the characteristics of inputvideo signal. The CTU includes a coding tree block (CTB) for a lumacomponent and the CTB for two chroma components that correspond to it.

One CTU may be split in a quad-tree structure. That is, one CTU may besplit into four units each having a square form and having a halfhorizontal size and a half vertical size, thereby being capable ofgenerating coding units (CUs). Such splitting of the quad-tree structuremay be recursively performed. That is, the CUs are hierarchically splitfrom one CTU in the quad-tree structure.

A CU means a basic unit for the processing process of an input videosignal, for example, coding in which intra/inter prediction isperformed. A CU includes a coding block (CB) for a luma component and aCB for two chroma components corresponding to the luma component. InHEVC, a CU size may be determined as one of 64×64, 32×32, 16×16, and8×8.

Referring to FIG. 3, the root node of a quad-tree is related to a CTU.The quad-tree is split until a leaf node is reached. The leaf nodecorresponds to a CU.

This is described in more detail. The CTU corresponds to the root nodeand has the smallest depth (i.e., depth=0) value. A CTU may not be splitdepending on the characteristics of an input video signal. In this case,the CTU corresponds to a CU.

A CTU may be split in a quad-tree form. As a result, lower nodes, thatis, a depth 1 (depth=1), are generated. Furthermore, a node (i.e., leafnode) that belongs to the lower nodes having the depth of 1 and that isno longer split corresponds to a CU. For example, in FIG. 3(b), a CU(a),a CU(b) and a CU(j) corresponding to nodes a, b and j have been oncesplit from the CTU, and have a depth of 1.

At least one of the nodes having the depth of 1 may be split in aquad-tree form. As a result, lower nodes having a depth 1 (i.e.,depth=2) are generated. Furthermore, a node (i.e., leaf node) thatbelongs to the lower nodes having the depth of 2 and that is no longersplit corresponds to a CU. For example, in FIG. 3(b), a CU(c), a CU(h)and a CU(i) corresponding to nodes c, h and i have been twice split fromthe CTU, and have a depth of 2.

Furthermore, at least one of the nodes having the depth of 2 may besplit in a quad-tree form again. As a result, lower nodes having a depth3 (i.e., depth=3) are generated. Furthermore, a node (i.e., leaf node)that belongs to the lower nodes having the depth of 3 and that is nolonger split corresponds to a CU. For example, in FIG. 3(b), a CU(d), aCU(e), a CU(f) and a CU(g) corresponding to nodes d, e, f and g havebeen three times split from the CTU, and have a depth of 3.

In the encoder, a maximum size or minimum size of a CU may be determinedbased on the characteristics of a video image (e.g., resolution) or byconsidering the encoding rate. Furthermore, information about themaximum or minimum size or information capable of deriving theinformation may be included in a bit stream. A CU having a maximum sizeis referred to as the largest coding unit (LCU), and a CU having aminimum size is referred to as the smallest coding unit (SCU).

In addition, a CU having a tree structure may be hierarchically splitwith predetermined maximum depth information (or maximum levelinformation). Furthermore, each split CU may have depth information.Since the depth information represents a split count and/or degree of aCU, it may include information about the size of a CU.

Since the LCU is split in a Quad-tree shape, the size of SCU may beobtained by using a size of LCU and the maximum depth information. Or,inversely, the size of LCU may be obtained by using a size of SCU andthe maximum depth information of the tree.

For a single CU, the information (e.g., a split CU flag (split_cu_flag))that represents whether the corresponding CU is split may be forwardedto the decoder. This split information is included in all CUs except theSCU. For example, when the value of the flag that represents whether tosplit is ‘1’, the corresponding CU is further split into four CUs, andwhen the value of the flag that represents whether to split is ‘0’, thecorresponding CU is not split any more, and the processing process forthe corresponding CU may be performed.

As described above, a CU is a basic unit of the coding in which theintra-prediction or the inter-prediction is performed. The HEVC splitsthe CU in a prediction unit (PU) for coding an input video signal moreeffectively.

A PU is a basic unit for generating a prediction block, and even in asingle CU, the prediction block may be generated in different way by aunit of PU. However, the intra-prediction and the inter-prediction arenot used together for the PUs that belong to a single CU, and the PUsthat belong to a single CU are coded by the same prediction method(i.e., the intra-prediction or the inter-prediction).

A PU is not split in the Quad-tree structure, but is split once in asingle CU in a predetermined shape. This will be described by referenceto the drawing below.

FIG. 4 is a diagram for describing a prediction unit that may be appliedto the present invention.

A PU is differently split depending on whether the intra-prediction modeis used or the inter-prediction mode is used as the coding mode of theCU to which the PU belongs.

FIG. 4(a) illustrates a PU if the intra-prediction mode is used, andFIG. 4(b) illustrates a PU if the inter-prediction mode is used.

Referring to FIG. 4(a), assuming that the size of a single CU is 2N×2N(N=4, 8, 16 and 32), the single CU may be split into two types (i.e.,2N×2N or N×N).

In this case, if a single CU is split into the PU of 2N×2N shape, itmeans that only one PU is present in a single CU.

Meanwhile, if a single CU is split into the PU of N×N shape, a single CUis split into four PUs, and different prediction blocks are generatedfor each PU unit. However, such PU splitting may be performed only ifthe size of CB for the luma component of CU is the minimum size (i.e.,the case that a CU is an SCU).

Referring to FIG. 4(b), assuming that the size of a single CU is 2N×2N(N=4, 8, 16 and 32), a single CU may be split into eight PU types (i.e.,2N×2N, N×N, 2N×N, N×2N, nL×2N, nR×2N, 2N×nU and 2N×nD)

As in the intra-prediction, the PU split of N×N shape may be performedonly if the size of CB for the luma component of CU is the minimum size(i.e., the case that a CU is an SCU).

The inter-prediction supports the PU split in the shape of 2N×N that issplit in a horizontal direction and in the shape of N×2N that is splitin a vertical direction.

In addition, the inter-prediction supports the PU split in the shape ofnL×2N, nR×2N, 2N×nU and 2N×nD, which is an asymmetric motion split(AMP). In this case, ‘n’ means ¼ value of 2N. However, the AMP may notbe used if the CU to which the PU is belonged is the CU of minimum size.

In order to encode the input video signal in a single CTU efficiently,the optimal split structure of the coding unit (CU), the prediction unit(PU) and the transform unit (TU) may be determined based on a minimumrate-distortion value through the processing process as follows. Forexample, as for the optimal CU split process in a 64×64 CTU, therate-distortion cost may be calculated through the split process from aCU of 64×64 size to a CU of 8×8 size. The detailed process is asfollows.

1) The optimal split structure of a PU and TU that generates the minimumrate distortion value is determined by performinginter/intra-prediction, transformation/quantization,dequantization/inverse transformation and entropy encoding on the CU of64×64 size.

2) The optimal split structure of a PU and TU is determined to split the64×64 CU into four CUs of 32×32 size and to generate the minimum ratedistortion value for each 32×32 CU.

3) The optimal split structure of a PU and TU is determined to furthersplit the 32×32 CU into four CUs of 16×16 size and to generate theminimum rate distortion value for each 16×16 CU.

4) The optimal split structure of a PU and TU is determined to furthersplit the 16×16 CU into four CUs of 8×8 size and to generate the minimumrate distortion value for each 8×8 CU.

5) The optimal split structure of a CU in the 16×16 block is determinedby comparing the rate-distortion value of the 16×16 CU obtained in theprocess 3) with the addition of the rate-distortion value of the four8×8 CUs obtained in the process 4). This process is also performed forremaining three 16×16 CUs in the same manner.

6) The optimal split structure of CU in the 32×32 block is determined bycomparing the rate-distortion value of the 32×32 CU obtained in theprocess 2) with the addition of the rate-distortion value of the four16×16 CUs that is obtained in the process 5). This process is alsoperformed for remaining three 32×32 CUs in the same manner.

7) Finally, the optimal split structure of CU in the 64×64 block isdetermined by comparing the rate-distortion value of the 64×64 CUobtained in the process 1) with the addition of the rate-distortionvalue of the four 32×32 CUs obtained in the process 6).

In the intra-prediction mode, a prediction mode is selected as a PUunit, and prediction and reconstruction are performed on the selectedprediction mode in an actual TU unit.

A TU means a basic unit in which actual prediction and reconstructionare performed. A TU includes a transform block (TB) for a luma componentand a TB for two chroma components corresponding to the luma component.

In the example of FIG. 3, as in an example in which one CTU is split inthe quad-tree structure to generate a CU, a TU is hierarchically splitfrom one CU to be coded in the quad-tree structure.

TUs split from a CU may be split into smaller and lower TUs because a TUis split in the quad-tree structure. In HEVC, the size of a TU may bedetermined to be as one of 32×32, 16×16, 8×8 and 4×4.

Referring back to FIG. 3, the root node of a quad-tree is assumed to berelated to a CU. The quad-tree is split until a leaf node is reached,and the leaf node corresponds to a TU.

This is described in more detail. A CU corresponds to a root node andhas the smallest depth (i.e., depth=0) value. A CU may not be splitdepending on the characteristics of an input image. In this case, the CUcorresponds to a TU.

A CU may be split in a quad-tree form. As a result, lower nodes having adepth 1 (depth=1) are generated. Furthermore, a node (i.e., leaf node)that belongs to the lower nodes having the depth of 1 and that is nolonger split corresponds to a TU. For example, in FIG. 3(b), a TU(a), aTU(b) and a TU(j) corresponding to the nodes a, b and j are once splitfrom a CU and have a depth of 1.

At least one of the nodes having the depth of 1 may be split in aquad-tree form again. As a result, lower nodes having a depth 2 (i.e.,depth=2) are generated. Furthermore, a node (i.e., leaf node) thatbelongs to the lower nodes having the depth of 2 and that is no longersplit corresponds to a TU. For example, in FIG. 3(b), a TU(c), a TU(h)and a TU(i) corresponding to the node c, h and l have been split twicefrom the CU and have the depth of 2.

Furthermore, at least one of the nodes having the depth of 2 may besplit in a quad-tree form again. As a result, lower nodes having a depth3 (i.e., depth=3) are generated. Furthermore, a node (i.e., leaf node)that belongs to the lower nodes having the depth of 3 and that is nolonger split corresponds to a CU. For example, in

FIG. 3(b), a TU(d), a TU(e), a TU(f) and a TU(g) corresponding to thenodes d, e, f and g have been three times split from the CU and have thedepth of 3.

A TU having a tree structure may be hierarchically split withpredetermined maximum depth information (or maximum level information).Furthermore, each spit TU may have depth information. The depthinformation may include information about the size of the TU because itindicates the split number and/or degree of the TU.

Information (e.g., a split TU flag “split_transform_flag”) indicatingwhether a corresponding TU has been split with respect to one TU may betransferred to the decoder. The split information is included in all ofTUs other than a TU of a minimum size. For example, if the value of theflag indicating whether a TU has been split is “1”, the corresponding TUis split into four TUs. If the value of the flag indicating whether a TUhas been split is “0”, the corresponding TU is no longer split.

Prediction

In order to reconfigure a current processing unit on which decoding isperformed, a decoded part of a current picture or other picturesincluding the current processing unit may be used.

A picture (slice) using only a current picture for reconstruction, thatis, on which only intra prediction is performed, may be called an intrapicture or l picture (slice). A picture (slice) using a maximum of onemotion vector and reference index in order to predict each unit may becalled a predictive picture or P picture (slice). A picture (slice)using a maximum of two motion vectors and reference indices may becalled a bi-predictive picture or B picture (slice).

Intra prediction means a prediction method of deriving a currentprocessing block from a data element (e.g., a sample value) of the samedecoded picture (or slice). That is, intra prediction means a method ofpredicting a pixel value of a current processing block with reference toreconstructed areas within a current picture.

Inter prediction means a prediction method of deriving a currentprocessing block based on a data element (e.g., a sample value or amotion vector) of a picture other than a current picture. That is, interprediction means a method of predicting a pixel value of a currentprocessing block with reference to reconstructed areas within anotherreconstructed picture other than a current picture.

Hereinafter, intra prediction is described more specifically.

Intra Prediction (or Prediction within Frame)

FIG. 5 is an embodiment to which the present invention is applied and isa diagram illustrating an intra prediction method.

Referring to FIG. 5, the decoder derives an intra prediction mode of acurrent processing block (S501).

Intra prediction may have a prediction direction for the position of areference sample used for prediction depending on a prediction mode. Anintra prediction mode having a prediction direction is referred to as anintra-angular prediction mode (Intra_Angular prediction mode). Incontrast, an intra prediction mode not having a prediction directionincludes an intra planar (INTRA_PLANAR) prediction mode and an intra DC(INTRA_DC) prediction mode.

Table 1 illustrates intra-prediction modes and associated names, andFIG. 6 illustrates a prediction direction according to anintra-prediction mode.

TABLE 1 INTRA- PREDICTION MODE ASSOCIATED NAMES 0 Intra-planar(INTRA_PLANAR) 1 Intra-DC (INTRA_DC) 2 . . . , 34 intra-angular 2 . . ., intra-angular 34 (INTRA_ANGULAR2 . . . , INTRA_ANGULAR34)

In intra-prediction, prediction is performed on a current processingblock based on a derived prediction mode. A reference sample used forprediction and a detailed prediction method are different depending on aprediction mode. If a current block is an intra-prediction mode, thedecoder derives the prediction mode of a current block in order toperform prediction.

The decoder checks whether neighboring samples of the current processingblock can be used for prediction and constructs reference samples to beused for the prediction (S502).

In intra-prediction, neighboring samples of the current processing blockmean a sample neighboring the left boundary of current processing blockof an nS×nS size, a total of 2×nS samples neighboring a bottom left ofthe current processing block, a sample neighboring the top boundary ofthe current processing block, a total of 2×nS samples neighboring thetop right of the current processing block, and one sample neighboringthe top left of the current processing block.

However, some of the neighboring samples of the current processing blockhave not yet been coded or may not be available. In this case, thedecoder may construct reference samples to be used for prediction bysubstituting unavailable samples with available samples.

The decoder may perform filtering on the reference samples based on theintra-prediction mode (S503).

Whether or not to perform the filtering of the reference samples may bedetermined based on the size of the current processing block.Furthermore, the filtering method of the reference samples may bedetermined based on a filtering flag transferred by the encoder.

The decoder generates a prediction block for the current processingblock based on the intra prediction mode and the reference samples(S504). That is, the decoder generates a prediction block for thecurrent processing block (i.e., generates a prediction sample within thecurrent processing block) based on the intra prediction mode derived inthe intra prediction mode derivation step (S501) and the referencesamples obtained in the reference sample configuration step (S502) andthe reference sample filtering step (S503).

If a current processing block has been encoded in the INTRA_DC mode, inorder to minimize the discontinuity of the boundary between processingblocks, a left boundary sample (i.e., a sample within a prediction blockneighboring a left boundary) and top boundary sample (i.e., a samplewithin a prediction block neighboring a top boundary) of the predictionblock may be filtered at step S504.

Furthermore, at step S504, with respect to the vertical mode andhorizontal mode of intra-angular prediction modes, as in the INTRA_DCmode, filtering may be applied to a left boundary sample or a topboundary sample.

More specifically, if a current processing block has been encoded in thevertical mode or horizontal mode, a value of a prediction sample may bederived based on a value of a reference sample positioned in theprediction direction. In this case, a boundary sample not positioned inthe prediction direction among a left boundary sample or top boundarysample of a prediction block may neighbor a reference sample not usedfor prediction. That is, the distance from a reference sample not usedfor prediction may be much closer than the distance from a referencesample used for prediction.

Accordingly, the decoder may adaptively apply filtering to left boundarysamples or top boundary samples depending on whether an intra predictiondirection is a vertical direction or a horizontal direction. That is,the decoder may apply filtering to left boundary samples if the intraprediction direction is a vertical direction, and may apply filtering totop boundary samples if the intra prediction direction is a horizontaldirection.

Quadtree Plus Binary Tree (QTBT)

A QTBT refers to a block structure in which a block is split using aquad-tree method and additional split is then performed using a binarytree method.

Specifically, in the QTBT block split structure, after block split isperformed in a quad-tree shape as in the existing method, split isadditionally performed in a binary tree shape through the signaling ofsplit flag information.

FIG. 7 is a diagram for illustrating a split structure of a block whichmay be applied to the present invention.

FIG. 7 illustrates a block split structure of a QTBT structure. A blockdivided by a solid line indicates a block split in a quad-treestructure, that is, a quad-tree shape. In this case, the quad-treestructure may be split using a method, such as the method described inFIG. 3.

Furthermore, a block divided by a dotted line indicates a block split ina binary tree structure, that is, a binary tree shape. Additional splitmay be performed in a binary tree structure based on the block structuresplit in a quad-tree shape.

Specifically, after quad-tree block split is performed, the encoder maysplit a block in a binary tree structure by signaling a split flag and aflag indicating horizontal direction split or vertical direction split.

In accordance with the QTBT block structure, there may be a block of arectangle (i.e., a non-square) shape other than a block of a regularquadrilateral (i.e., square) shape depending on the characteristics ofvideo. Furthermore, transform in addition to prediction may be performedbased on the finally split block.

That is, in the existing HEVC, in intra prediction, the prediction of aPU unit and the transform and quantization of a TU unit are performed ina square block. In contrast, in intra prediction of a QTBT blockstructure, intra prediction may be performed in a rectangular block inaddition to a regular quadrilateral block, and prediction, transform andquantization may be performed based on a split block without theexisting hierarchical structure of a PU or TU.

Intra Prediction Mode-Based Video Processing Method

As described above, if prediction within a frame (or intra prediction)is performed based on a QTBT block structure, unlike in the existingHEVC, intra prediction may be performed in a non-square block inaddition to a square block.

The present invention proposes a method of efficiently performingprediction by taking into consideration the characteristics of a blockshape when a prediction block is generated in a non-square block unitthrough intra prediction.

Embodiment 1

As described in FIG. 5, the encoder/decoder may identify whether samplesneighboring a current block can be used for prediction in order toperform intra prediction, and may configure reference samples to be usedfor prediction.

If intra prediction is performed in a square block, as in the existingHEVC, a sample neighboring the left boundary of a current block of anN×N size and a total of 2×N samples neighboring the bottom left of thecurrent block, a sample neighboring the top boundary of the currentblock and a total of 2×N samples neighboring the top right of thecurrent block and one sample neighboring the top left of the currentblock may be configured as reference samples to be used for prediction.

Furthermore, if some of the surrounding samples of the current block hasnot yet been decoded or is not available, the encoder/decoder mayconfigure reference samples to be used for prediction by substitutingunavailable samples with available samples.

In contrast, as described above, intra prediction may be performed in anon-square block in addition to a square block.

Accordingly, the present embodiment proposes a method of configuring (orpadding) a reference sample to be used for intra prediction by takinginto consideration a shape of a non-square block.

FIG. 8 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of configuring a referencesample.

Referring to FIG. 8(a), the prediction direction of an intra predictionmode may have an angle of 45° to 225°. However, this is merely anexample for illustrating the present invention based on the existingintra prediction mode (refer to FIG. 6), and an intra prediction mode towhich the present invention may be applied is not limited thereto.

In an intra prediction method of a non-square block, in order toidentically apply the direction of an intra prediction mode applied tothe existing square block, a reference sample may be configured (orprepared) by taking into consideration the horizontal length (i.e.,width) and vertical length (i.e., height) of a current block.

That is, the encoder/decoder may configure a reference sample to be usedfor the prediction of a current block by taking into consideration theprediction direction of an intra prediction mode having an angle of 45°to 225° and the width and height of the current block.

Referring to FIG. 8(b), a case where the width of a current block, thatis, a non-square block, is W and the height t hereof is H is assumed.

For example, if intra prediction is performed in the current block, onesample neighboring the top left of the current block, H samplesneighboring the left of the current block, W samples neighboring thebottom left of the current block, W samples neighboring the top of thecurrent block and H samples neighboring the top right of the currentblock may be configured as reference samples to be used for prediction.

Furthermore, if some of the surrounding samples of the current block hasnot yet been decoded or is not available, the encoder/decoder mayconfigure reference samples to be used for prediction by substitutingunavailable samples with available samples.

Furthermore, the encoder/decoder may pad a reference sample and thenperform filtering on the reference sample using the method described inFIG. 5.

FIG. 9 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of configuring a referencesample.

From FIG. 9, a maximum reference sample area necessary for intraprediction may be seen if intra prediction is performed in a non-squareblock.

Specifically, referring to FIG. 9(a), a case where the predictiondirection of an intra prediction mode is an angle of 45° is assumed.When the width of a current block 901 is W and the height thereof is H,a prediction sample of the current block 901 may be generated using Wsamples neighboring the top of the current block 901 and H samplesneighboring the top right of the current block 901.

Referring to FIG. 9(b), a case where the prediction direction of anintra prediction mode is an angle of 225° is assumed. When the width ofa current block 902 is W and the height thereof is H, a predictionsample of the current block 902 may be generated using H samplesneighboring the left of the current block 902 and W samples neighboringthe bottom left of the current block 902.

Embodiment 2

In intra prediction, a sample value of a reference sample is duplicateddepending on a direction of an intra prediction mode. Accordingly, whenthe distance between a prediction sample and the reference sampleincreases, the precision of prediction may be degraded compared to asample whose distance from a reference sample is not increased.Furthermore, as the distance between a prediction sample and a referencesample increases, a prediction error may increase, and thus compressionperformance may be degraded due to an increased residual signal.

A problem occurring depending on the prediction direction of an intraprediction mode in a non-square block is described.

Referring back to FIG. 9(a), the distance from a reference sample isdifferent depending on the position of a prediction sample within thecurrent block 901 (or the prediction block of the current block 901) inthe same prediction direction (i.e., an angle of 45°).

Specifically, the distance between a top-right sample of the currentblock 901 and the reference sample is close. In contrast, the distancebetween a bottom-right sample of the current block 901 and the referencesample is relatively distant. That is, each prediction sample within thecurrent block 901 may have different precision of prediction dependingon its position because prediction is performed using a reference samplepositioned at the start point of each arrow shown in FIG. 9(a).

Furthermore, a prediction error occurs as the distance between eachprediction sample of the current block 901 and a reference samplebecomes distant. Accordingly, the precision of prediction may bedegraded as the distance from the reference sample becomes distantbecause the prediction sample is generated using a sample of atransferred state.

In contrast, referring back to FIG. 9(b), it may be seen that ifprediction is performed in a prediction direction of an angle of 225°symmetrical to an angle of 45° with respect to a prediction direction ofan angle of 135° (i.e., No. 18 prediction mode in HEVC, for example),each prediction sample within the current block 902 has a sameprediction error according to the distance from a reference sample.

In other words, unlike in the prediction direction of an angle of 45° inFIG. 9(a), in the current block 902, a prediction sample having the samevertical coordinate may have the same prediction error according to thedistance from a reference sample because the prediction sample has aconstant distance from the reference sample.

Furthermore, a prediction error may relatively less occur because thedistance between the prediction sample and the reference sample iscloser compared to the case of the prediction direction of an angle of45°.

That is, if intra prediction is performed in a non-square block havingthe same shape, a different prediction error may occur depending on thedirection of an intra prediction mode. Accordingly, the probability thata prediction direction having a less prediction error may be selected asan intra prediction mode may be higher because the prediction directionof an intra prediction mode may have different prediction performance.

Accordingly, the present embodiment proposes a method of adaptivelyredistributing (or distributing or determining) the prediction directionof an intra prediction mode by taking into consideration a non-squareblock.

In the existing intra prediction method, all prediction directions areuniformly (i.e., to have the same density) disposed. In contrast, amethod proposed in the present embodiment can maximize predictionperformance by disposing more prediction directions on the side of adirection having a less error.

FIG. 10 is an embodiment to which the present invention may be appliedand is a diagram for illustrating a method of adaptively determining anintra prediction mode.

Referring to FIG. 10, FIG. 10(a) illustrates a distribution method ofintra prediction modes according to the existing method, and FIG. 10(b)illustrates a distribution method of intra prediction modes according toa method proposed in the present embodiment.

Referring to FIG. 10(a), according to the existing method, predictiondirections uniform with respect to a direction symmetrical with respectto the prediction direction of an angle of 135° are used as intraprediction modes.

In contrast, referring to FIG. 10(b), according to the method proposedin the present embodiment, more prediction directions may be used on theside of a direction having a longer length of the width and height of acurrent block among directions symmetrical with respect to theprediction direction of an angle of 135°.

In other words, if the width is greater among the width and height of acurrent block, a more number of prediction directions may be distributedbetween the prediction direction of an angle of 45° and the predictiondirection of an angle of 135° than between the prediction direction ofthe angle of 135° and the prediction direction of an angle of 225°. Ifthe height is greater among the width and height of a current block, amore number of prediction directions may be distributed between theprediction direction of an angle of 135° and the prediction direction ofan angle of 225° than between the prediction direction of an angle of45° and the prediction direction of the angle of 135°.

Accordingly, the present embodiment proposes a method of differentiallydistributing the prediction direction (i.e., angle) of an intraprediction mode depending on the width and height in block structureshaving various width (horizontal) and height (vertical) ratios as in aQTBT block structure.

Hereinafter, the present embodiment is described based on a case wherethe existing intra prediction mode is used (or applied) without anychange, but the present invention is not limited thereto. Accordingly, amethod proposed in the present embodiment may also be applied to a casewhere the existing intra prediction mode is not used without any change.

Hereinafter, various methods of adaptively determining an intraprediction mode are described as examples.

As described above, if intra prediction is performed in a non-squareblock, the distance between a prediction sample and a reference samplewithin a current block may be different depending on the predictiondirection of an intra prediction mode. Furthermore, as the distance fromthe reference sample becomes distant, a prediction error may rise andthe precision of prediction may be degraded.

Accordingly, the encoder/decoder can reduce bits for representing anintra prediction mode in an encoding/decoding process by removing aspecific number of prediction directions from the prediction directionsof intra prediction modes based on the width and height ratio of acurrent block in the prediction directions of the intra predictionmodes.

FIG. 11 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of adaptively determining anintra prediction mode.

Referring to FIG. 11(a), a case where the width (or horizontal) andheight (or vertical) ratio of a current block is 2:1 is assumed.

In this case, as described above, the prediction direction of an angleof 225° may have a higher prediction error according to the distancefrom a reference sample than the prediction direction of an angle of45°. Accordingly, the encoder/decoder may redistribute intra predictionmodes by removing the prediction direction of the angle of 225° and twoprediction directions neighboring the prediction direction of the angleof 225°, that is, a total of three prediction directions 1101, from theexisting intra prediction modes.

Referring to FIG. 11(b), a case where the width (or horizontal) andheight (or vertical) ratio of a current block is 1:2 is assumed.

In this case, as described above, the probability that the predictiondirection of an angle of 45° has a higher prediction error according tothe distance from a reference sample than the prediction direction of anangle of 225° may occur. Accordingly, the encoder/decoder mayredistribute intra prediction modes by removing the prediction directionof the angle of 45° and two prediction directions neighboring theprediction direction of the angle of 45°, that is, a total of threeprediction directions 1102, from the existing intra prediction modes.

In this case, a case where the number of removed intra prediction modesis 3 is assumed and described, for convenience of description, but thisis only one example and the present invention is not limited thereto.

FIG. 12 is an embodiment to which the present invention may be appliedand is a diagram illustrating a method of adaptively determining anintra prediction mode.

Referring to FIG. 12 (a), a case where the width (or horizontal) andheight (or vertical) ratio of a current block is 2:1 is assumed.

In this case, as described above, the probability that the predictiondirection of an angle of 225° has a higher prediction error according tothe distance from a reference sample than the prediction direction of anangle of 45° may occur. Accordingly, the encoder/decoder mayredistribute intra prediction modes in such a manner that threeprediction directions are sequentially removed from the existing intraprediction modes by sub-sampling or down-sampling the predictiondirections with respect to the prediction direction of the angle of225°.

In other words, the intra prediction modes may be redistributed byremoving a total of three prediction directions for each predictiondirection having a smaller angle every two prediction directions withrespect to the prediction direction of the angle of 225°.

Referring to FIG. 12(b), a case where the width (or horizontal) andheight (or vertical) ratio of a current block is 1:2 is assumed.

In this case, as described above, the probability that the predictiondirection of an angle of 45° has a higher prediction error according tothe distance from a reference sample than the prediction direction of anangle of 225° may occur. Accordingly, the encoder/decoder mayredistribute intra prediction modes in such a manner that threeprediction directions are sequentially removed from the existing intraprediction mode by sub-sampling or down-sampling the predictiondirections with respect to the prediction direction of the angle of 45°.

In other words, the encoder/decoder may redistribute the intraprediction modes by removing a total of three prediction direction foreach prediction direction having a greater angle every two predictiondirections with respect to the prediction direction of the angle of 45°.

In this case, a case where the number of removed intra prediction modesis 3 is assumed and described, for convenience of description, but thisis only one example and the present invention is not limited thereto.Furthermore, a case where the sub-sampling or down-sampling ratio is 1/2is assumed and described, but this is only one example and the presentinvention is not limited thereto.

In this case, the ratio means the ratio of a distribution degree (ordensity) of prediction directions before sub-sampling or down-samplingis applied and a distribution degree (or density) of predictiondirections after sub-sampling or down-sampling is applied within aspecific angle range from which prediction directions are removed.

In order to reduce bits representing a prediction direction through amethod of removing a specific number of prediction directions from theprediction directions of intra prediction modes described in FIGS. 11and 12, a total of 16 directions must be removed on the basis of the 33types of directions in HEVC. A prediction direction removed by themethod described in FIG. 11 or 12 may be positioned as a direction thatcannot be represented by the existing prediction direction because theremoval of the 16 directions may degrade coding efficiency as describedabove.

That is, by subdividing and representing prediction directions of aspecific angle range corresponding to the number of removed directions,bits used for the encoding of an intra prediction mode can bemaintained, a detailed direction that cannot be represented in aconventional technology can be represented, and thus predictionperformance can be improved.

FIGS. 13 to 15 are embodiments to which the present invention may beapplied and are diagrams illustrating a method of adaptively determiningan intra prediction mode.

Hereinafter, in FIGS. 13 to 15, a case where a sub-sampling ordown-sampling ratio is 1/2 is assumed, for convenience of description,but this is only one example and the present invention is not limitedthereto. That is, the sub-sampling or down-sampling ratio may beperformed at any ratio.

Furthermore, in FIGS. 13 to 15, a case where two prediction modes areremoved by the method described in FIG. 12 is assumed, for convenienceof description, but this is only one example and the present inventionis not limited thereto. A prediction mode may be removed by the methoddescribed in FIG. 11, and two or less or two or more prediction modesmay be removed.

Referring to FIG. 13(a), if the width and height ratio of a currentblock is 2:1 and two prediction directions have been removed from theprediction directions of intra prediction modes, the encoder/decoder mayposition one prediction direction 1301 of the two prediction directionsbetween two prediction directions neighboring the left of a verticalmode, and may position the other prediction direction 1302 between twoprediction directions neighboring the right of the vertical mode.

The precision of prediction can be improved by removing a predictiondirection having a relatively higher probability of a prediction errorand adding a prediction direction that cannot be represented by theprediction direction of the existing intra prediction mode.

Likewise, referring to FIG. 13(b), if the width and height ratio of acurrent block is 1:2 and two prediction directions have been removedamong the prediction directions of intra prediction modes, theencoder/decoder may position one prediction direction 1303 of the twoprediction directions between two prediction directions neighboring thetop of a horizontal mode, and may position the other predictiondirection 1304 between two prediction directions neighboring the bottomof the horizontal mode.

Although not shown in FIG. 13, the encoder/decoder may distributeprediction modes by disposing the two removed prediction directionsbetween a prediction direction of the horizontal mode or vertical modeand a prediction direction closest to each prediction direction.

Referring to FIG. 14(a), if the width and height ratio of a currentblock is 2:1 and two prediction directions have been removed among theprediction directions of intra prediction modes, the encoder/decoder mayposition one prediction direction 1401 of the two prediction directionsbetween two prediction directions neighboring the top of a horizontalmode, and may position the other prediction direction 1402 between twoprediction directions neighboring the bottom of the horizontal mode.

The precision of prediction can be improved by removing a predictiondirection having a relatively higher probability of a prediction errorand adding a prediction direction that cannot be represented by theprediction direction of the existing intra prediction mode as describedabove.

Likewise, referring to FIG. 14(b), if the width and height ratio of acurrent block is 1:2 and two prediction directions have been removedamong the prediction directions of intra prediction modes, theencoder/decoder may position one prediction direction 1403 of the twoprediction directions between two prediction directions neighboring theleft of a vertical mode, and may position the other prediction direction1404 between two prediction directions neighboring the right of thevertical mode.

Although not shown in FIG. 14, prediction modes may be distributed bydisposing the two prediction directions between the prediction directionof the horizontal mode or the vertical mode and a prediction directionclosest to each prediction direction.

Referring to FIG. 15(a), if the width and height ratio of a currentblock is 2:1 and two prediction directions have been removed from theprediction directions of intra prediction modes, the encoder/decoder maydispose two prediction directions 1501 in a prediction direction of anangle of 45° or less.

The precision of prediction can be improved by removing a predictiondirection having a relatively higher probability of a prediction errorand adding a prediction direction that cannot be represented by theprediction direction of the existing intra prediction mode.

If a prediction direction of an angle of 45° or less is used asdescribed above, the range of reference samples that may be used forprediction may be different. That is, when the width of a current block,that is, a non-square block, is W and the height thereof is H, referencesamples may be configured (or padded) using a larger number of samplesthan H samples (refer to FIG. 8(b)) as samples neighboring the top rightof the current block depending on an angle of a prediction direction.

Likewise, referring to FIG. 15(b), if the width and height ratio of acurrent block is 1:2 and two prediction directions have been removedamong the prediction directions of intra prediction modes, theencoder/decoder may dispose two prediction directions 1502 in aprediction direction of an angle 225° or more.

If a prediction direction of an angle of 225° or more is used asdescribed above, the range of reference samples that may be used forprediction may be different. That is, when the width of a current block,that is, a non-square block, is W and the height is

H, reference samples may be configured (or padded) using a larger numberof samples than W samples (refer to FIG. 8(b)) as samples neighboringthe bottom left of the current block depending on an angle of aprediction direction.

The methods of adaptively distributing intra prediction modes have beendescribed assuming a case where the width and height ratio of a currentblock is 2:1 or 1:2. The invention proposed in this specification may beidentically applied to other cases in addition to the above-describedratios. This is described with reference to the following drawings.

FIGS. 16 and 17 are embodiments to which the present invention may beapplied and are diagrams illustrating a method of adaptively determiningan intra prediction mode.

In FIGS. 16 and 17, a case where the width and height ratio of a currentblock is N:M or M:N is assumed (in this case, N>M). As described above,in the QTBT block structure, blocks having various width and heightratios may be determined.

Accordingly, a method proposed in the present embodiment may be appliedto non-square blocks of all shapes which may be determined in such ablock structure.

Hereinafter, in FIGS. 16 and 17, a case where a sub-sampling ordown-sampling ratio is 1/2 is assumed, for convenience of description,but this is only one example and the present invention is not limitedthereto. That is, the sub-sampling or down-sampling ratio may beperformed at any ratio.

Furthermore, in FIGS. 16 and 17, a case where two prediction modes areremoved using the method described in FIG. 12 is assumed, forconvenience of description, but this is only one example and the presentinvention is not limited thereto. A prediction mode may be removed usingthe method described in FIG. 11, and two or less or two or moreprediction modes may be removed.

Referring to FIG. 16(a), if the width and height ratio of a currentblock is N:M and two prediction directions have been removed among theprediction directions of intra prediction modes, the encoder/decoder mayposition one prediction direction 1601 of the two prediction directionsbetween two prediction directions neighboring the left of a verticalmode, and may position the other prediction direction 1602 between twoprediction directions neighboring the right of the vertical mode.

The precision of prediction can be improved by removing a predictiondirection having a relatively higher probability of a prediction errorand adding a prediction direction that cannot be represented by theprediction direction of the existing intra prediction mode.

Likewise, referring to FIG. 16(b), if the width and height ratio of acurrent block is M:N and two prediction directions have been removedamong the prediction directions of intra prediction modes, theencoder/decoder may position one prediction direction 1603 of the twoprediction directions between two prediction directions neighboring thetop of a horizontal mode, and may position the other predictiondirection 1604 between two prediction directions neighboring the bottomof the horizontal mode.

Although not shown in FIG. 16, prediction modes may be distributed bydisposing the two removed prediction directions between a predictiondirection of the horizontal mode or vertical mode and a predictiondirection closest to each prediction direction.

Referring to FIG. 17(a), if the width and height ratio of a currentblock is N:M and two prediction directions have been removed among theprediction directions of intra prediction modes, the encoder/decoder mayposition one prediction direction 1701 of the two prediction directionsbetween two prediction directions neighboring the top of a horizontalmode, and may position the other prediction direction 1702 between twoprediction directions neighboring the bottom of the horizontal mode.

The precision of prediction can be improved by removing a predictiondirection having a relatively higher probability of a prediction errorand adding a prediction direction that cannot be represented by theprediction direction of the existing intra prediction mode as describedabove.

Likewise, referring to FIG. 17(b), if the width and height ratio of acurrent block is M:N and two prediction directions have been removedamong the prediction directions of intra prediction modes, theencoder/decoder may position one prediction direction 1703 of the twoprediction directions between two prediction directions neighboring theleft of a vertical mode, and may position the other prediction direction1704 between two prediction directions neighboring the right of thevertical mode.

Although not shown in FIG. 17, the encoder/decoder may distributeprediction modes by disposing the two removed prediction directionsbetween a prediction direction of the horizontal mode or the verticalmode and a prediction direction closest to each prediction direction.

Embodiment 3

The present embodiment proposes a method of splitting a transform unitbased on the direction of an intra prediction mode and a shape of ablock without adding a separate syntax by taking into consideration anon-square block.

Hereinafter, in the description of the present invention, a unit bywhich transform is performed is denoted as a transform unit (TU), forconvenience of description, but the present invention is not limitedthereto. That is, a basic unit by which the transform of a residualsignal is performed may be referred to as a different name other thanthe TU unit

As described in Embodiment 2, if prediction is performed in a non-squareblock, a prediction error may be different depending on the predictiondirection of an intra prediction mode.

When such a problem is taken into consideration, coding efficiency of acoding structure in which prediction, transform, quantization, etc. areperformed in the same block structure regardless of a TU and a PU, suchas the QTBT is inevitably degraded.

Accordingly, the present invention proposes a split method of a TU inorder to solve the above-described problem occurring in a non-squareblock. Furthermore, the present invention proposes a method of improvingcoding efficiency by determining the split of a TU without adding aseparate syntax and performing an intra prediction mode.

In the QTBT structure, a CU, a PU, and a TU are not classified, but in amethod proposed in the present embodiment, a TU is split using adifference in the width (or horizontal) and height (or vertical) of anon-square block.

If intra prediction is performed in a non-square block, theencoder/decoder may adaptively determine the spit of a TU by taking intoconsideration the direction of an intra prediction mode.

FIG. 18 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

In FIG. 18, it is assumed that a current block is a block having aheight longer than a width among non-square blocks.

Referring to FIG. 18(a), if the split of a TU is not present, a sample1801 located on the center right of a current block refers to a firstreference sample 1802 determined based on an intra prediction mode shownin FIG. 18(a). Furthermore, a sample 1803 located on the bottom right ofthe current block refers to a second reference sample 1804 determinedbased on an intra prediction mode.

The distance between the sample 1803 located on the bottom right of thenon-square current block and the second reference sample 1804 is fartherthan the distance between the sample 1801 located on the right of thecenter and the second reference sample 1804. In such a case, asdescribed above, a prediction error is increased, and the precision ofprediction may be degraded. Accordingly, the encoder/decoder mayadaptively perform the split of a TU by taking such a problem intoconsideration.

FIG. 18(b) illustrates a case where a current block, that is, anon-square block, is split into two square TUs.

That is, the encoder/decoder may split the current block into the squareTUs based on the direction of an intra prediction mode in order to solvethe problem of FIG. 18(a).

A bottom-right sample 1807 within a top TU 1805 refers to a firstreference sample 1808. In this case, the distance from the referencesample 1808 is the same as that of the case of FIG. 18(a).

In contrast, it may be seen that a bottom-right sample 1809 within abottom TU 1806 refers to a second reference sample 1810, and thus thedistance between the bottom-right sample 1809 and the reference sample1810 is reduced compared to the case of FIG. 18(a) (i.e., when the splitof a TU is not present).

Furthermore, actual prediction and reconfiguration may be performed in aTU unit split in an intra prediction mode.

FIG. 19 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

A sample 1901 located on the center right of a current block refers to afirst reference sample 1902 determined based on an intra prediction modeshown in FIG. 19. Furthermore, a sample 1903 located on the bottom rightof the current block refers to a second reference sample 1904 determinedbased on an intra prediction mode.

In this case, a prediction error is the same and the above-describedproblem does not occur because the distance from the reference sample isthe same between prediction samples having the same vertical coordinateswithin the current block depending on the direction of an intraprediction mode. Accordingly, in such a case, a gain transformperformance can be obtained by performing transform, quantization, etc.without performing the split of a TU.

That is, a prediction error can be reduced and the precision ofprediction can be improved because the distance between a predictionsample and a reference sample is reduced by adaptively performing thesplit of a TU based on the prediction direction of an intra predictionmode in a non-square block.

Specifically, a method of determining whether to perform the split of aTU is described with reference to the following drawing.

Hereinafter, a block having a width greater than a height amongnon-square blocks is referred to as a wide block, and a block having aheight greater than a width among non-square blocks is referred to as anarrow block for convenience of description.

FIG. 20 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 20(a) shows a case where in the case of a wide block, the angle ofa prediction direction of an intra prediction mode is between 180° and225°. In this case, the distance between a prediction sample and areference sample can be reduced by performing the split of a TU.

That is, the encoder/decoder performs the split of a TU when the angleof a prediction direction of an intra prediction mode is between 180°and 225°. In this case, the TU may be split into square blocks. That is,the encoder/decoder splits the TU into square blocks, each one havingthe height of a current block as the length of one side.

FIG. 20(b) shows a case where in the case of a narrow block, the angleof a prediction direction of an intra prediction mode is between 45° and90°. In this case, the distance between a prediction sample and areference sample can be reduced by performing the split of a TU.

That is, the encoder/decoder performs the split of a TU when the angleof a prediction direction of an intra prediction mode is between 45° and90°. In this case, the TU may be split into square blocks. That is, theencoder/decoder splits the TU into square blocks, each one having thewidth of a current block as the length of one side.

FIG. 21 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 21(a) shows a case where in the case of a wide block, the angle ofa prediction direction of an intra prediction mode is between 45° and180°.

The encoder/decoder may not perform the split of a TU when the angle ofa prediction direction of an intra prediction mode is between 45° and180°.

FIG. 20(b) shows a case where in the case of a narrow block, the angleof a prediction direction of an intra prediction mode is between 90° and225°.

The encoder/decoder may not perform the split of a TU when the angle ofa prediction direction of an intra prediction mode is between 90° and225°.

That is, if a prediction error according to the distance from areference sample corresponds to a constant intra prediction mode, theencoder/decoder may not perform the split of a TU.

FIG. 22 is a flowchart illustrating a split method of a transform unitaccording to an embodiment of the present invention.

The encoder/decoder determines whether a current block on which intraprediction is performed is a non-square block (S2201).

If, as a result of the determination at step S2201, the current block isa non-square block, the encoder/decoder determines whether the width ofthe current block is greater than the height thereof (S2202).

If, as a result of the determination at step S2202, the width of thecurrent block is greater than the height, the encoder/decoder determineswhether the angle of an intra prediction mode is greater than 180°(S2203).

If, as a result of the determination at step S2203, the angle of theprediction mode of the intra prediction mode is greater than 180°, theencoder/decoder reconstructs an intra prediction block in the split TUunit (S2205, S2206).

That is, when the angle of the prediction mode of the intra predictionmode is greater than 180°, the encoder/decoder performs the split of aTU on the current block, and reconstructs an intra predicted block inthe split TU unit.

If, as a result of the determination at step S2202, the width of thecurrent block is smaller than the height thereof, the encoder/decoderdetermines whether the angle of the intra prediction mode is smallerthan 90° (S2204).

If, as a result of the determination at step S2204, the angle of theprediction mode of the intra prediction mode is smaller than 90°, theencoder/decoder reconstructs an intra prediction block in a split TUunit (S2205, S2206).

If, as a result of the determination at step S2201, the current block isnot a non-square block, if, as a result of the determination at stepS2203, the angle of the prediction mode of the intra prediction mode isnot greater than 180° or if, as a result of the determination at stepS2204, the angle of the prediction mode of the intra prediction mode isnot smaller than 90°, the encoder/decoder reconstructs a current block(S2207).

That is, in this case, the encoder/decoder reconstructs the currentblock without performing the split of a TU.

Embodiment 4

The present embodiment proposes a method of splitting a transform unitwithout adding a separate syntax by taking into consideration anon-square block.

Specifically, there is proposed a method of performing a TU split bytaking into consideration the width and height ratio of a non-squareblock. The split of a TU may be performed in a batch based on the widthand height of a current block without taking into consideration an intraprediction direction.

A method proposed in the present embodiment has an advantage in thatcomputational complexity is small compared to the adaptive split methodof a TU proposed in Embodiment 3.

FIG. 23 is a diagram illustrating a split method of a transform unitaccording to an embodiment of the present invention.

FIG. 23(a) shows a case where when the width (or horizontality) of acurrent block is W and the height (or verticality) thereof is H, theratio of the width and the height is 1:2. In this case, theencoder/decoder may split the current block into two

TUs, each one having a W×W size.

FIG. 23(b) shows a case where when the width (or horizontality) of acurrent block is W and the height (or verticality) is H, the ratio ofthe width and the height is 1:2. In this case, the encoder/decoder maysplit the current block into four TUs, each one having a W×W size.

That is, in the existing QTBT block structure, a PU and a TU are notclassified. In contrast, according to the method proposed in the presentembodiment, the split of a TU may be performed in a batch in anon-square block.

The distance between a prediction sample and a reference sample can bereduced based on the prediction direction of an intra prediction mode byperforming a TU split on a non-square current block as described in FIG.18. Accordingly, a prediction error can be reduced, and the precision ofprediction can be improved.

Furthermore, as in Embodiment 3, the encoder/decoder performsencoding/decoding based on a split TU. In other words, prediction may beperformed and reconfiguration (i.e., reconstruction) may be performedusing an actual reference sample in a split TU unit.

FIG. 24 is a diagram illustrating an intra prediction method accordingto an embodiment of the present invention.

If a current block is a non-square block, the encoder/decoder configuresa reference sample to be used for the prediction of the current blockbased on width and height information of the current block (S2401).

As described in FIG. 8, when the size of a current block is N×M, theencoder/decoder may configure reference samples to be used for theprediction of the current block using one sample neighboring the topleft of the current block, M samples neighboring the left of the currentblock, N samples neighboring the bottom left of the current block, Nsamples neighboring the top of the current block, and M samplesneighboring the top right of the current block.

Furthermore, as described above, if some of the surrounding samples ofthe current block has not yet been decoded or is not available, theencoder/decoder may configure reference samples to be used forprediction by substituting unavailable samples with available samples.

Furthermore, after a reference sample is padded, the encoder/decoder mayperform the filtering of the reference sample using the method describedin FIG. 5.

The encoder/decoder derives the intra prediction mode of the currentblock (S2402).

The encoder/decoder may derive the intra prediction mode of the currentblock using the method described in FIG. 5.

Furthermore, the encoder/decoder may adaptively determine a plurality ofintra prediction modes that will be applied to the current block basedon the width and height information of the current block. In this case,the intra prediction mode of the current block may be derived from amongthe plurality of determined intra prediction modes. That is, the intraprediction mode of the current block may be determined as one of theplurality of determined intra prediction modes.

As described above, the encoder/decoder may differentially distributeprediction directions of intra prediction mode candidates based on thewidth and height ratio of a current block.

In other words, a plurality of intra prediction modes applicable to thecurrent block may be determined as intra prediction modes havingdifferentially distributed prediction directions based on the ratio ofthe width and height of the current block.

Furthermore, as described above, when the width is greater among thewidth and height of a current block, the encoder/decoder may distributea larger number of prediction directions between the predictiondirection of an angle of 45° and the prediction direction of an angle of135° than between the prediction direction of the angle of 135° and theprediction direction of an angle of 225°.

Furthermore, when the height is greater among the width and height of acurrent block, the encoder/decoder may distribute a larger number ofprediction directions between the prediction direction of an angle of135° and the prediction direction of an angle of 225° than between theprediction direction of an angle of 45° and the prediction direction ofthe angle of 135°.

Furthermore, as described above, the encoder/decoder can reduce bits torepresent an intra prediction mode in an encoding/decoding process byremoving a specific number of prediction directions from the predictiondirections of intra prediction modes based on the width and height ratioof a current block among the prediction directions of the intraprediction modes.

Furthermore, as described above, the encoder/decoder may redistributeintra prediction modes in such a manner that prediction directions areremoved by sub-sampling prediction directions of a specific angle rangeamong the prediction directions of intra prediction mode candidatesbased on the width and height ratio of a current block.

Furthermore, as described above, the encoder/decoder may dispose aremoved prediction direction as a direction that cannot be representedby the existing prediction direction.

Specifically, a plurality of prediction directions of the predictiondirections of intra prediction mode candidates may be removed based onthe width and height ratio of a current block, and prediction directionsmay be added to a specific angle range, including vertical modes orhorizontal modes corresponding to the number of removed predictiondirection.

Furthermore, a plurality of prediction directions of the predictiondirections of intra prediction mode candidates may be removed based onthe width and height ratio of a current block, and prediction directionscorresponding to the number of removed prediction directions may beadded between a plurality of prediction directions neighboring avertical mode or horizontal mode.

The encoder/decoder generates a prediction sample of the current blockusing the reference sample based on the intra prediction mode of thecurrent block (S2403).

Furthermore, if intra prediction is performed in a non-square block, theencoder/decoder may adaptively determine the split of a transform unitby taking into consideration the direction of an intra prediction mode.

For example, the encoder/decoder may determine whether to split acurrent block into a plurality of square sub-blocks based on the widthand height ratio of the current block. Furthermore, in this case, thesub-block may be identical with a transform unit by which the residualsignal of the current block is transformed. If the current block is notsplit into a plurality of square sub-blocks, the encoder/decoder maygenerate a prediction sample of the current block in the current blockunit. If the current block is split into a plurality of squaresub-blocks, the encoder/decoder may generate a prediction sample of thecurrent block in the sub-block unit.

Furthermore, for example, when the width is greater in the width andheight of the current block and the angle of the intra prediction modeof the current block is greater than 180°, the encoder/decoder may splitthe current block into a plurality of square sub-blocks. In this case,the sub-block may be identical with a transform unit by which theresidual signal of the current block is transformed. Furthermore, theprediction sample of the current block may be generated in the sub-blockunit using the reference sample based on the intra prediction mode ofthe current block.

Furthermore, for example, when the height is greater in the width andheight of the current block and the angle of the intra prediction modeof the current block is smaller than 90°, the encoder/decoder may splitthe current block into a plurality of square sub-blocks. In this case,the sub-block may be identical with a transform unit by which theresidual signal of the current block is transformed. Furthermore, theprediction sample of the current block may be generated in the sub-blockunit using the reference sample based on the intra prediction mode ofthe current block.

Furthermore, for example, the encoder/decoder may split the currentblock into a plurality of square sub-blocks. In this case, the sub-blockmay be identical with a transform unit by which the residual signal ofthe current block is transformed. Furthermore, the prediction sample ofthe current block may be generated in the sub-block unit using thereference sample based on the intra prediction mode of the currentblock.

FIG. 25 is a diagram illustrating an intra prediction unit according toan embodiment of the present invention.

In FIG. 25, the intra prediction unit has been illustrated as being asingle block, for convenience of description, but the intra predictionunit may be implemented as an element included in the encoder and/or thedecoder.

Referring to FIG. 25, the intra prediction unit implements thefunctions, processes and/or methods proposed in FIGS. 5 to 24.Specifically, the intra prediction unit may include a reference sampleconfiguration unit 2501, a prediction mode derivation unit 2502 and aprediction sample generation unit 2503.

The reference sample configuration unit 2501 configures a referencesample to be used for the prediction of a current block based on widthand height information of the current block if the current block is anon-square block.

As described in FIG. 8, if the size of a current block is N×M, thereference sample configuration unit 2501 may configure reference samplesto be used for prediction of the current block using one sampleneighboring the top left of the current block, M samples neighboring theleft of the current block, N samples neighboring the bottom left of thecurrent block, N samples neighboring the top of the current block, and Msamples neighboring the top right of the current block.

Furthermore, as described above, if some of the surrounding samples ofthe current block has not yet been decoded or is not available, thereference sample configuration unit 2501 may configure reference samplesto be used for prediction by substituting unavailable samples withavailable samples.

Furthermore, after a reference sample is padded, the reference sampleconfiguration unit 2501 may perform the filtering of the referencesample using the method described in FIG. 5.

The prediction mode derivation unit 2502 derives the intra predictionmode of the current block.

As described above, the prediction mode distribution unit 2502 maydifferentially distribute the prediction directions of intra predictionmode candidates based on the width and height ratio of a current block.

The prediction mode derivation unit 2502 may derive the intra predictionmode of a current block using the method described in FIG. 5.

Furthermore, the prediction mode derivation unit 2502 may adaptivelydetermine a plurality of intra prediction modes to be applied to acurrent block based on width and height information of the currentblock. In this case, the intra prediction mode of the current block maybe derived from among the plurality of determined intra predictionmodes. That is, the intra prediction mode of the current block may bedetermined as one intra prediction mode of the plurality of determinedintra prediction modes.

Furthermore, as described above, when the width is greater among thewidth and height of a current block, the prediction mode derivation unit2502 may distribute a larger number of prediction directions between theprediction direction of an angle of 45° and the prediction direction ofan angle of 135° than between the prediction direction of the angle of135° and the prediction direction of an angle of 225°.

Furthermore, when the height is greater among the width and height of acurrent block, the prediction mode derivation unit 2502 may distribute alarger number of prediction directions between the prediction directionof an angle of 135° and the prediction direction of an angle of 225°than between the prediction direction of an angle of 45° and theprediction direction of the angle of 135°.

Furthermore, as described above, the prediction mode derivation unit2502 can reduce bits to represent an intra prediction mode in anencoding/decoding process by removing a specific number of predictiondirections from the prediction directions of intra prediction modesbased on the width and height ratio of a current block among theprediction directions of the intra prediction modes.

Furthermore, as described above, the prediction mode derivation unit2502 may redistribute intra prediction modes in such a manner thatprediction directions are removed by sub-sampling prediction directionsof a specific angle range among the prediction directions of intraprediction mode candidates based on the width and height ratio of acurrent block.

Furthermore, as described above, the prediction mode derivation unit2502 may position a removed prediction direction as a direction thatcannot be represented by the existing prediction direction.

Specifically, the prediction mode derivation unit 2502 may remove aplurality of prediction directions among the prediction directions ofintra prediction mode candidates based on the width and height ratio ofa current block, and may add prediction directions, corresponding to thenumber of removed prediction directions, to a specific angle rangeincluding a vertical mode or a horizontal mode.

Furthermore, the prediction mode derivation unit 2502 may remove aplurality of prediction directions among the prediction directions ofintra prediction mode candidates based on the width and height ratio ofa current block, and may add prediction directions, corresponding to thenumber of removed prediction directions, between a plurality ofprediction directions neighboring a vertical mode or a horizontal mode.

The prediction sample generation unit 2503 generates a prediction sampleof a current block using the reference sample based on the intraprediction mode of the current block.

Furthermore, as described above, if intra prediction is performed in anon-square block, the encoder/decoder may adaptively determine the splitof a transform unit by taking into consideration the direction of anintra prediction mode.

In the aforementioned embodiments, the elements and characteristics ofthe present invention have been combined in specific forms. Each of theelements or characteristics may be considered to be optional unlessexplicitly described otherwise. Each of the elements or characteristicsmay be implemented in a form not combined with another element orcharacteristic. Furthermore, some of the elements and/or thecharacteristics may be combined to form an embodiment of the presentinvention. The order of the operations described in connection with theembodiments of the present invention may be changed. Some of theelements or characteristics of an embodiment may be included in anotherembodiment or may be replaced with corresponding elements orcharacteristics of another embodiment. It is evident that an embodimentmay be constructed by combining claims not having an explicit citationrelation in the claims or may be included as a new claim by amendmentsafter filing an application.

An embodiment of the present invention may be implemented by variousmeans, for example, hardware, firmware, software or a combination ofthem. In the case of implementations by hardware, an embodiment of thepresent invention may be implemented using one or moreapplication-specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), processors, controllers, microcontrollers and/ormicroprocessors.

In the case of an implementation by firmware or software, an embodimentof the present invention may be implemented in the form of a module,procedure, or function for performing the aforementioned functions oroperations. Software code may be stored in memory and driven by aprocessor. The memory may be located inside or outside the processor,and may exchange data with the processor through a variety of knownmeans.

It is evident to those skilled in the art that the present invention maybe materialized in other specific forms without departing from theessential characteristics of the present invention. Accordingly, thedetailed description should not be construed as being limitative fromall aspects, but should be construed as being illustrative. The scope ofthe present invention should be determined by reasonable analysis of theattached claims, and all changes within the equivalent range of thepresent invention are included in the scope of the present invention.

INDUSTRIAL APPLICABILITY

As described above, the preferred embodiments of the present inventionhave been disclosed for illustrative purposes, and those skilled in theart may improve, change, substitute, or add various other embodimentswithout departing from the technological spirit and scope of the presentinvention disclosed in the attached claims.

1. A method of processing video based on an intra prediction mode, themethod comprising: configuring a reference sample to be used forprediction of a current block based on width and height information ofthe current block when the current block is a non-square block; derivingan intra prediction mode of the current block; and generating aprediction sample of the current block using the reference sample basedon the intra prediction mode of the current block.
 2. The method ofclaim 1, wherein the step of deriving the intra prediction mode of thecurrent block further comprises the step of adaptively determining aplurality of intra prediction modes applicable to the current blockbased on the width and height information of the current block, andwherein the intra prediction mode of the current block is derived amongthe plurality of determined intra prediction modes.
 3. The method ofclaim 1, wherein when the width of the current block is N and the heightof the current block is M, the reference sample is configured with onesample neighboring a top left of the current block, M samplesneighboring a left of the current block, N samples neighboring a bottomleft of the current block, N samples neighboring a top of the currentblock and M samples neighboring a top right of the current block.
 4. Themethod of claim 2, wherein the plurality of intra prediction modesapplicable to the current block is determined as intra prediction modesin which prediction directions are differentially distributed based on aratio of the width and height of the current block.
 5. The method ofclaim 2, wherein when the width is greater among the width and height ofthe current block, the plurality of intra prediction modes applicable tothe current block is determined as intra prediction modes in which anumber of prediction directions is more distributed between a predictiondirection of an angle of 45° and a prediction direction of an angle of135° than between a prediction direction of an angle of 135° and aprediction of an angle of 225°.
 6. The method of claim 2, wherein whenthe height is greater among the width and height of the current block,the plurality of intra prediction modes applicable to the current blockis determined as intra prediction modes in which a number of predictiondirections is more distributed between a prediction direction of anangle of 135° and a prediction of an angle of 225° than between aprediction direction of an angle of 45° and a prediction direction of anangle of 135°.
 7. The method of claim 2, wherein the plurality of intraprediction modes applicable to the current block is determined as intraprediction modes from which a specific number of prediction directionshave been removed based on a ratio of the width and height of thecurrent block.
 8. The method of claim 2, wherein the plurality of intraprediction modes applicable to the current block is determined bysub-sampling a prediction direction of a specific angle range based on aratio of the width and height of the current block.
 9. The method ofclaim 2, wherein the plurality of intra prediction modes applicable tothe current block is determined as intra prediction modes from which aplurality of prediction directions has been removed based on a ratio ofthe width and height of the current block and to which predictiondirections have been added to a specific angle range comprising avertical mode or horizontal mode as many as the number of removedprediction directions.
 10. The method of claim 2, wherein the pluralityof intra prediction modes applicable to the current block is determinedas intra prediction modes from which a plurality of predictiondirections has been removed based on a ratio of the width and height ofthe current block and to which prediction directions have been addedbetween a plurality of prediction directions neighboring to a verticalmode or horizontal mode as many as the number of removed predictiondirections.
 11. The method of claim 1, further comprising: determiningwhether to split the current block into a plurality of square sub-blocksbased on a ratio of the width and height of the current block, whereinif the current block is not split into a plurality of square sub-blocks,the prediction sample of the current block is generated in a currentblock unit, wherein if the current block is split into a plurality ofsquare sub-blocks, the prediction sample of the current block isgenerated in a sub-block unit, and wherein the sub-block is identicalwith a transform unit transforming a residual signal of the currentblock.
 12. The method of claim 1, further comprising: splitting thecurrent block into a plurality of square sub-blocks when the width isgreater among the width and height of the current block and an angle ofthe intra prediction mode of the current block is greater than 180°,wherein the prediction sample of the current block is generated in thesub-block unit using the reference sample based on the intra predictionmode of the current block, and wherein the sub-block is identical with atransform unit transforming a residual signal of the current block. 13.The method of claim 1, further comprising: splitting the current blockinto a plurality of square sub-blocks when the height is greater amongthe width and height of the current block and an angle of the intraprediction mode of the current block is smaller than 90°, wherein theprediction sample of the current block is generated in the sub-blockunit using the reference sample based on the intra prediction mode ofthe current block, and wherein the sub-block is identical with atransform unit transforming the residual signal of the current block.14. The method of claim 1, further comprising: splitting the currentblock into a plurality of square sub-blocks, wherein the predictionsample of the current block is generated in the sub-block unit using thereference sample based on the intra prediction mode of the currentblock, and wherein the sub-block is identical with a transform unittransforming the residual signal of the current block.
 15. An apparatusprocessing video based on an intra prediction mode, comprising: areference sample configuration unit configured to configure a referencesample to be used for prediction of a current block based on width andheight information of the current block when the current block is anon-square block; a prediction mode derivation unit configured to derivean intra prediction mode of the current block; and a prediction samplegeneration unit configured to generate a prediction sample of thecurrent block using the reference sample based on the intra predictionmode of the current block.